from time import sleep

from selenium.webdriver.common.by import By

from common.Utils import SearchDriver


class SearchSafeTest:
    driver = ""
    url = ""
    def __init__(self):
        self.driver = SearchDriver.driver
        self.url = "http://134.175.130.177:8080/"
        self.driver.get(self.url)

    def Safetes(self,str):
        self.driver.find_element(By.CSS_SELECTOR,"body > div > div.search > input[type=text]").send_keys(str)
        self.driver.find_element(By.CSS_SELECTOR,"body > div > div.search > button").click()
        sleep(4)
        self.driver.find_element(By.CSS_SELECTOR, "body > div > div.search > input[type=text]").clear()
        sleep(4)